#ifndef CDKEY_H
#define CDKEY_H

#include "config/ConfigDataModel.h"
#include "config/Items.h"
#include "global.h"

#define CONFIG_ITEM(TYPE,ID) \
    public: TYPE* ID = nullptr; \
    public: Q_PROPERTY(TYPE* ID MEMBER ID)


class CDKey : public ConfigDataModel
{
    Q_OBJECT
public:
    static CDKey& instance()
    {
        static CDKey cdkey;
        return cdkey;
    }


    void verify();
    TS::CDKeyLevel keyLevel();

    CONFIG_ITEM(ItemString, m_cdKey)

signals:
    void keyLevelChanged(TS::CDKeyLevel level);

protected:
    explicit CDKey(QObject *parent = nullptr);
    virtual void resetSelf() override;
    TS::CDKeyLevel m_keyLevel;
};

#undef CONFIG_ITEM

#endif // CDKEY_H
